package com.micangcaihang.micang.mvp.task.contract;

import com.micangcaihang.common.base.mvp.BaseModel;
import com.micangcaihang.common.base.mvp.BasePresenter;
import com.micangcaihang.common.base.mvp.IBaseView;
import com.micangcaihang.common.http.ApiResult;
import com.micangcaihang.micang.entity.TaskPriceSurveyEntity;

import io.reactivex.Observable;

/**
 * <pre>
 *     author : Fandy
 *     e-mail : fandayongfly@gmail.com
 *     time   : 2017/7/24
 *     update : 2017/7/24
 *     desc   : 价格调查
 *     version: 1.0
 * </pre>
 */
public interface TaskPriceSurveyContract {
    interface View extends IBaseView {

        /**
         * 返回价格调查信息
         *
         * @param entity
         */
        void returnPriceSurveyData(TaskPriceSurveyEntity entity);

        /**
         * 删除价格成功
         */
        void deletePriceSuccess();

    }

    interface Model extends BaseModel {
        /**
         * 获取价格调查数据
         *
         * @return
         */
        Observable<ApiResult<TaskPriceSurveyEntity>> getPriceSurveyData(String id);

        /**
         * 保存信息
         *
         * @return
         */
        Observable<ApiResult<Void>> savaPriceSurveyData(TaskPriceSurveyEntity request);

        /**
         * 保存新楼信息
         *
         * @return
         */
        Observable<ApiResult<Void>> savaXinlouData(TaskPriceSurveyEntity request);

        /**
         * 保存中介信息
         *
         * @return
         */
        Observable<ApiResult<Void>> savaZhongJieData(TaskPriceSurveyEntity request);

        /**
         * 删除价格
         *
         * @return
         */
        Observable<ApiResult<Void>> deletePriceData(String id, String evaluate_id);
    }

    abstract class Presenter extends BasePresenter<View> {
        /**
         * 加载房屋配套数据
         */
        public abstract void loadPriceSurveyData();

        /**
         * 保存信息
         *
         * @param request
         */
        public abstract void savePriceSurveyData(TaskPriceSurveyEntity request);

        /**
         * 删除价格调查
         *
         * @param id
         * @param evaluate_id
         */
        public abstract void deletePriceData(String id, String evaluate_id);
    }
}
